package com.zzyl.job;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.zzyl.entity.Reservation;
import com.zzyl.service.ReservationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
@Slf4j
public class ReservationJob {
    @Autowired
    private ReservationService reservationService;
    @XxlJob("reservationStatusToExpired")
    public void reservationStatus(){
        log.info("定时修改状态 -- begin");
        reservationService.updateReservationStatus(LocalDateTime.now());
        log.info("定时修改状态 -- end");
    }
}